package com.sfc.spiderweb.rest;

import com.sfc.spiderweb.entity.vo.Result;
import com.sfc.spiderweb.service.AmazonInfoToMysqlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "amazon数据存入数据库 ->Earl")
@RestController
@RequestMapping(value = "/amazonToMysql")
@Slf4j
public class AmazonInfoToMysql {

    @Autowired
    private AmazonInfoToMysqlService service;

    @ApiOperation(notes = "amazon日转款存入信息存入数据库", value = "")
    @GetMapping("/amazonTransfer")
    public Result amazonTransfer(@RequestParam(value = "nowDateStr", required = false) String nowDateStr) {
        service.amazonTransfer(nowDateStr);
        return Result.success();
    }

    @ApiOperation(notes = "amazon账号违规数据存入数据库", value = "")
    @GetMapping("/amazonViolationData")
    public Result amazonViolationData(@RequestParam(value = "nowDateStr", required = false) String nowDateStr) {
        service.amazonViolationData(nowDateStr);
        return Result.success();
    }

    @ApiOperation(notes = "amazon首页截图数据存入数据库", value = "")
    @GetMapping("/amazonIndexScreenshot")
    public Result amazonIndexScreenshot(@RequestParam(value = "nowDateStr", required = false) String nowDateStr) {
        service.amazonIndexScreenshot(nowDateStr);
        return Result.success();
    }



}
